package frame;

import java.util.Map;

import org.apache.http.HttpEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;

import com.crc.mam.AESUtil;

public class LoginInterface extends HttpHelper{
	
	
	public static String post(Map<String,String> header,String jsonObject,String url) throws Exception{
        HttpPost post = null;
        post = new HttpPost(url);
        if(header!=null){
            for(String key:header.keySet()){
                post.addHeader(key, header.get(key));
            }
        }
        if(jsonObject.isEmpty()){
            throw new Exception("jsonObject不能为空！");
        }
        String params = jsonObject.toString();
        AESUtil.encrypt(params);
        HttpEntity entity = new StringEntity(jsonObject,"UTF-8");
        return HttpClientHelper.getHttpClient().execute(post);
    }

}
